Changed size requisition so the viewport does not add the border thickness
authorMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jul 2007 20:01:54 +0000 (20:01 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 9 Jul 2007 20:01:54 +0000 (20:01 +0000)
2007-07-09  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkviewport.c (gtk_viewport_size_request): Changed size
        requisition so the viewport does not add the border thickness
        if it has GTK_SHADOW_NONE selected.  (#361781, Miguel Gomez)

svn path=/trunk/; revision=18421

ChangeLog
gtk/gtkviewport.c

index 7662c9650e0d8d31574152fba7c917e78a8bbd5d..44e898efdbd267c2893a2ff0f94676bc69e380ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkviewport.c (gtk_viewport_size_request): Changed size 
+       requisition so the viewport does not add the border thickness 
+       if it has GTK_SHADOW_NONE selected.  (#361781, Miguel Gomez)
+
 2007-07-09  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktooltip.c (gtk_tooltip_trigger_tooltip_query): 
index 114415b088a5135dd5aa4174c9d731ad9d80715c..48fac8329ae86c2c137ae4924644bed097b9c605 100644 (file)
@@ -712,11 +712,15 @@ gtk_viewport_size_request (GtkWidget      *widget,
 
   bin = GTK_BIN (widget);
 
-  requisition->width = (GTK_CONTAINER (widget)->border_width +
-                       GTK_WIDGET (widget)->style->xthickness) * 2;
+  requisition->width = GTK_CONTAINER (widget)->border_width;
 
-  requisition->height = (GTK_CONTAINER (widget)->border_width * 2 +
-                        GTK_WIDGET (widget)->style->ythickness) * 2;
+  requisition->height = GTK_CONTAINER (widget)->border_width;
+
+  if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE)
+    {
+      requisition->width += 2 * widget->style->xthickness;
+      requisition->height += 2 * widget->style->ythickness;
+    }
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {